import Vue from 'vue'
import Vuex from 'vuex'
import router from "./routers";
import App from './App.vue'
import ElementUI from 'element-ui'
import VueRouter from 'vue-router'
import 'element-ui/lib/theme-chalk/index.css'
import 'element-ui/lib/theme-chalk/display.css'
import './assets/style.css'
import fHeader from './components/f-header'
import fFooter from './components/f-footer'
import store from "./store";
import i18n from './i18n/i18n'
import hljs from 'highlight.js' //导入代码高亮文件
import storage from "./model/storage";
import 'highlight.js/styles/monokai-sublime.css'  //导入代码高亮样式
import 'github-markdown-css/github-markdown.css'

// highlight.js代码高亮插件
import Highlight from './utils/highlight'; // from 路径是highlight.js的路径，纯属自定义
Vue.use(Highlight);
Vue.config.productionTip = false
Vue.use(ElementUI)
Vue.use(VueRouter)
Vue.use(Vuex)
Vue.component("f-header",fHeader)
Vue.component("f-footer",fFooter)
Vue.directive('highlight',function (el) {
	let highlight = el.querySelectorAll('pre');
	highlight.forEach((block)=>{
		hljs.highlightBlock(block)
	})
})

//Vue.use(ElementUI, {
//i18n: (key, value) => i18n.t(key, value)
//})




// const router =new VueRouter({
// 	mode: 'history'
// })

new Vue({
	router,
	i18n,
	storage,
	store,
	render: h => h(App),
}).$mount('#app')
